UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2qJ5quLfFMBpwx+GjE6ry3c3ZgAXrX3yCC2rtRpPxeQ='
WHERE
key_id = 'f10fea2b684aaf43c9393fab6f95f67de2a7c296d043343fbe0eeb6f75a74439'
AND (
token = '2qJ5quLfFMBpwx+GjE6ry3c3ZgAXrX3yCC2rtRpPxeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)