UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vroBiYub/ug7kkSkVkfCaqVLjMteboN3wP5OvJbkzyM=' 
WHERE 
  key_id = '0830908eb22a142f71c55b760ad61775862610927ed721e1be906a78195896f0' 
  AND (
    token = 'vroBiYub/ug7kkSkVkfCaqVLjMteboN3wP5OvJbkzyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037