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

Query time 0.00159