UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't6TQ6Kr3uOcFwbKShZ9RiQTqw0KxHpJ5J3gqrQbD0ls=' 
WHERE 
  key_id = 'b2fcc2fc9d233518d4dc607efa86ab7ae19890a6c52e2f5a8feb8a0823d488e7' 
  AND (
    token = 't6TQ6Kr3uOcFwbKShZ9RiQTqw0KxHpJ5J3gqrQbD0ls=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034