UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0CmoSvJuGFkngDlmuWFOaZJ4DSvHHaXem+idEk/oIFY='
WHERE
key_id = '600120e7b807eb8540bffebf687990113b7b0b53cabcab022fb53c2ef67d16c2'
AND (
token = '0CmoSvJuGFkngDlmuWFOaZJ4DSvHHaXem+idEk/oIFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)