UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'szmsnWt6sI9z5cBldOFSU2QjCrmSfL92OubDBZomw0Q='
WHERE
key_id = '56738b3d383b132ee3355c6f585ced4a80f73acfe42f67c9c511ca1a0ab44a42'
AND (
token = 'szmsnWt6sI9z5cBldOFSU2QjCrmSfL92OubDBZomw0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)