UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RWsUtch1MoSbXG4OdYH82lVGOGzt4rR9bcBOkDBgIIs='
WHERE
key_id = '73f78ff051f13a67fbaf9a7839339a0a6b85745e6f5b47948df8198d31bc8d7b'
AND (
token = 'RWsUtch1MoSbXG4OdYH82lVGOGzt4rR9bcBOkDBgIIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)