UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1wwqNffQy19x8aGcm7rDrIWKATxxg5JipgSC3+Zwlos=' 
WHERE 
  key_id = '25f04bfadc5360e96888995d33da8cf6583e5077776dd7622b8c724a2b5f1a35' 
  AND (
    token = '1wwqNffQy19x8aGcm7rDrIWKATxxg5JipgSC3+Zwlos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032