UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ImkmY++feCIt1I3VKeTDBQjfYwkkVy79J0KxBP9eHI=' 
WHERE 
  key_id = '3932714e2c7678e1f327032d351bc76408756d566d70858d9ff5de93c9a35e8a' 
  AND (
    token = '7ImkmY++feCIt1I3VKeTDBQjfYwkkVy79J0KxBP9eHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032