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

Query time 0.00041