UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '10YgpQLacoKm7M3V1fFfq5b9BQGN6EwQ6LFfRkppCM0=' 
WHERE 
  key_id = 'aec3f22c977ee11518f31a1eadffe5224415d43971c85dfc83182bcb620d733f' 
  AND (
    token = '10YgpQLacoKm7M3V1fFfq5b9BQGN6EwQ6LFfRkppCM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032