UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PuMO2cWWgAShEGnBXzzQzELsUN/qFKW2e7Yp6g/mG5M=' 
WHERE 
  key_id = '901cf6aaa593ce2c3f14f89107bff04ae79192882c3a126a11b3c635a65a22a0' 
  AND (
    token = 'PuMO2cWWgAShEGnBXzzQzELsUN/qFKW2e7Yp6g/mG5M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040