UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wh+OS58Yn39h6o5TKWE2Wdjg+mFeh//p0csVMzbuyWU=' 
WHERE 
  key_id = '76070288447974bac95a812cbbc96fa350b1c9de52e666d0f82f7bef1fff8d7b' 
  AND (
    token = 'Wh+OS58Yn39h6o5TKWE2Wdjg+mFeh//p0csVMzbuyWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025