UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fVyobiNs5thUPLSyHIkhs5QlRMrp6fA5MA5MfO2rxIA=' 
WHERE 
  key_id = '5b09edbed1164ec3eb0704a18be42c20ea3ff3f8108cd1360d5115be97cf1350' 
  AND (
    token = 'fVyobiNs5thUPLSyHIkhs5QlRMrp6fA5MA5MfO2rxIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037