UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '32/85jQfZW2CuBEVZXNepZnwuCuieQvtNlt/YH95Epo=' 
WHERE 
  key_id = '26c90671a2cc660c708ae122c50a17f6d69f6e5c32844fb7ba2fa965789f799b' 
  AND (
    token = '32/85jQfZW2CuBEVZXNepZnwuCuieQvtNlt/YH95Epo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037