UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SnAOZjrSItzKU0eg3+ZOsG/fRjoKX7oBq7tqD6cJPac='
WHERE
key_id = '04bad7f2d592481f1bbf997426e0e58297fce72d6e9381c7c8a0e542f09dd26b'
AND (
token = 'SnAOZjrSItzKU0eg3+ZOsG/fRjoKX7oBq7tqD6cJPac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)