UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wa3HRdEeSr/Wg8v+kz5rQxYkf/MwXfHhDRaPZevCF9U='
WHERE
key_id = 'e8c791124a2b37eaac813666c622f78707d8a4cb455c2f31741adab328ed6785'
AND (
token = 'Wa3HRdEeSr/Wg8v+kz5rQxYkf/MwXfHhDRaPZevCF9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)