UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G/YhlDka7GrQhSYfNJJB9pQOElf5gpUSn2Ge85t9vNM=' 
WHERE 
  key_id = '8454eaa09204da891f0b87f165f830e4e6d59b2b4df01bcad833980cd432cd13' 
  AND (
    token = 'G/YhlDka7GrQhSYfNJJB9pQOElf5gpUSn2Ge85t9vNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019