UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8NVMmVq43qbsKDBjeD1fJ5CZsPOUFvkJhGhvK98FSpA=' 
WHERE 
  key_id = '16b203e118ab6f18656aea482777cc75050c4fb79db98611a2b5c17b7db3b58c' 
  AND (
    token = '8NVMmVq43qbsKDBjeD1fJ5CZsPOUFvkJhGhvK98FSpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039