UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZuvM3a/frPT73qEV/DOeKIBQsaq1zRLnXw8Cs/8jbeo=' 
WHERE 
  key_id = '738c2c6e460c6dee87724dfe663623e509bebc8a5727374fcbf81f924043de1c' 
  AND (
    token = 'ZuvM3a/frPT73qEV/DOeKIBQsaq1zRLnXw8Cs/8jbeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037