UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hgsON9lkwIQzdGI02OsQc9GXHbfNT0Ti1Ydq+s0cYwk=' 
WHERE 
  key_id = 'f73506446f53a05ace37eb49dc6513448a2e4e5c4f4e066fa3973587db7199a6' 
  AND (
    token = 'hgsON9lkwIQzdGI02OsQc9GXHbfNT0Ti1Ydq+s0cYwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036