UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zu1W1Qf2e5jbiPLJXyHdUhoVuREUyvftwCl5AI7I4FQ='
WHERE
key_id = '0dd6b25f9c4568b91b02c7bdb3365d4fb586752e73886878c30c5729f14ac54a'
AND (
token = 'zu1W1Qf2e5jbiPLJXyHdUhoVuREUyvftwCl5AI7I4FQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)