UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fT6AMlg1SpBIMWKl7eoyMjuqMEaTXiv2q1YHKWgKP/I='
WHERE
key_id = 'cb85aaf318d750cf7a9d5e2911e98b07b072d067d14e5e36a45934272ae12d26'
AND (
token = 'fT6AMlg1SpBIMWKl7eoyMjuqMEaTXiv2q1YHKWgKP/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)