UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gzwE++A3iRXTtmYSV/E3fVL+v2vrkm8cz+PVj68oS4Y=' 
WHERE 
  key_id = 'b11307b03225090c7bb2890e71db3057600614f80cff3c5b01c8a0ea4ad28aae' 
  AND (
    token = 'gzwE++A3iRXTtmYSV/E3fVL+v2vrkm8cz+PVj68oS4Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026