UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YBvEckavCZzHO9RheQm+h8xv3+iLX0QNViTOKrEJeWc=' 
WHERE 
  key_id = 'b92e2da5ddd36c8b3464f6c6fe22d47d27f3ede13883827de6abd1cfc0b699a2' 
  AND (
    token = 'YBvEckavCZzHO9RheQm+h8xv3+iLX0QNViTOKrEJeWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034