UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eQ/6DOIGwb48iUgkptnfXD39zF8irn2JtdMPSdo5fko='
WHERE
key_id = '999e290d3b0bce6590ec256d5c26e7887d484c9b2df7652eeef21a5453381c0a'
AND (
token = 'eQ/6DOIGwb48iUgkptnfXD39zF8irn2JtdMPSdo5fko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)