UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GZTSOxRZb8iZhbaXVHbNAdLS7QsQdDcSFRiATHNBQHU=' 
WHERE 
  key_id = '1442d052253619ee9799c6dce1a7ce8e65f468961b21864f4c72672bca09b589' 
  AND (
    token = 'GZTSOxRZb8iZhbaXVHbNAdLS7QsQdDcSFRiATHNBQHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039