UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ec4Pio+7dFELLVmd6UojKwFaOShsGUF8gae7Y5gSFuc='
WHERE
key_id = 'a06893ec8128c9a1c4f5bd3bce7c8b54b199c6ed4b0b57a30004bb122100d49f'
AND (
token = 'ec4Pio+7dFELLVmd6UojKwFaOShsGUF8gae7Y5gSFuc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)