UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l5jMJs7lvW3+E3twbiLVIGBFZhj7KkXLnNqxB70zlkU='
WHERE
key_id = '206681a00cfa423980269e60f84616ae2bc5bc2ad0db68d7c2d6efd1ffa0895d'
AND (
token = 'l5jMJs7lvW3+E3twbiLVIGBFZhj7KkXLnNqxB70zlkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)