UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/aRkYc4qZNse7FJ2HcJ7eTKXcrduZ2Fg5FlyZH0hUBY=' 
WHERE 
  key_id = 'c4fda83b373497a7b2ae1380d6810ad0a1777e1b5e46de3aafd4dc58b9e27cd7' 
  AND (
    token = '/aRkYc4qZNse7FJ2HcJ7eTKXcrduZ2Fg5FlyZH0hUBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048