UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ARNJuWH0sXIbQBXCUoYY2EXa3og0voOTxQ6VCtjGB8E=' 
WHERE 
  key_id = 'd48dcbbbacaa602c82a122526ed4b77b23997a1bbcea38e4bd83f36462da8222' 
  AND (
    token = 'ARNJuWH0sXIbQBXCUoYY2EXa3og0voOTxQ6VCtjGB8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017