UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W5Mr9ck0U003J95ZFi3ellym0XGjcJi/+FTR/xRvNqI=' 
WHERE 
  key_id = 'f067c231c8e620ebd557faf9131be019ac1d1915f342dd82c652f1cb2f643bbd' 
  AND (
    token = 'W5Mr9ck0U003J95ZFi3ellym0XGjcJi/+FTR/xRvNqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036