UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LEA7ir7H+tseuANq9njjSO3u+eyAc174ehr2IxWduQc='
WHERE
key_id = '0af2859dcc9ba3cb59cdfa2f53657e3375d00ec616b7edaf09919d71893276f5'
AND (
token = 'LEA7ir7H+tseuANq9njjSO3u+eyAc174ehr2IxWduQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)