UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vHFCgCakD2OdWUJVmqoe/uO1rbKyHgQkH2cSzy+R9hI=' 
WHERE 
  key_id = '5efe92a71be147815ed542e65db338a4b7abbc26aeee93d32ce0f0b474c10e80' 
  AND (
    token = 'vHFCgCakD2OdWUJVmqoe/uO1rbKyHgQkH2cSzy+R9hI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034