UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u+1LQI8V4EJRCHDBSyNYSGifJaIzJiMgF2t1T9pk7PA=' 
WHERE 
  key_id = '1e669401d8ca3fcf0bd7ab3f97710d3239d9e8ba41d54a86d8d4f4707c7f6c78' 
  AND (
    token = 'u+1LQI8V4EJRCHDBSyNYSGifJaIzJiMgF2t1T9pk7PA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030