UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x7qvkwStITK/M06iUTcNmaz5Gxu9I6bwIxF37+j02+g=' 
WHERE 
  key_id = '8e2eaedf54d98aa6bdc749697bb326eeff55afa0113ddadfadab2b684c17837b' 
  AND (
    token = 'x7qvkwStITK/M06iUTcNmaz5Gxu9I6bwIxF37+j02+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050