UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WDzaJywBXBnE/seoBBt1QSObSSlBpkPZOyNUnTG4RXM=' 
WHERE 
  key_id = '59f5dddedc24ac2709644027a2f45c1e1bb7b162e9e140e712ee080ddfb33498' 
  AND (
    token = 'WDzaJywBXBnE/seoBBt1QSObSSlBpkPZOyNUnTG4RXM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031