UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QGfL8jfnzuXAe1CQLEjs7wScUD+do2UZAUXu4D9q5XM=' 
WHERE 
  key_id = 'b593cf045d6863ab674eee1dd315f9af92034263abd5722dcfc4ab9170aa79f2' 
  AND (
    token = 'QGfL8jfnzuXAe1CQLEjs7wScUD+do2UZAUXu4D9q5XM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031