UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UyMx+wObYdN+fC/+SnYPZe0e5tCyD0q2G3S6cRvBTFg=' 
WHERE 
  key_id = '045c32ce15ff652eb575b67857c8b73fd5d08eed489b28ad09f702bec96d086f' 
  AND (
    token = 'UyMx+wObYdN+fC/+SnYPZe0e5tCyD0q2G3S6cRvBTFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044