UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cORSrDtmaPeBQxVVpVlGK33eYpIOnaRvvDr219B4aoE='
WHERE
key_id = '92010f141ab0750c95526b491e48c9bde9d0bf708c3a0ff890c02cf315215502'
AND (
token = 'cORSrDtmaPeBQxVVpVlGK33eYpIOnaRvvDr219B4aoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)