UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bcmgw0uJWFtOjeHMvnQCNkoNBrkLAwWRSoNcd7+9EcM='
WHERE
key_id = '0fec9b14daefcff5e622ab7be841e1dfb7008b5ae586db6622ced458bb566b0c'
AND (
token = 'Bcmgw0uJWFtOjeHMvnQCNkoNBrkLAwWRSoNcd7+9EcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)