UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZN5zdaBDlc5iflY4bvqBtC6caUurWWm6S3IgxohEjes=' 
WHERE 
  key_id = '1007928f21c5b5a8f1bcefac97fe00e54e76b290ad00a090475f94e32ffb177b' 
  AND (
    token = 'ZN5zdaBDlc5iflY4bvqBtC6caUurWWm6S3IgxohEjes=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036