UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mVYZV/gxoZRANZtoZ1jh2QPkfbRSH8oepgfgq1S8Pkw='
WHERE
key_id = '49c12e01b7a26654fed1fb7f9b98cb0f768a504ba7136ab3657e750b5237f77c'
AND (
token = 'mVYZV/gxoZRANZtoZ1jh2QPkfbRSH8oepgfgq1S8Pkw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)