UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8CsG9h1i1mUOlOSpHGSL66QAD4wg8mL80Xg9Oo6Q8MI=' 
WHERE 
  key_id = '6080dce6b4c417d3d30aa1e7de68f1122e64b4c9ce46d946bbe7bba58f0d0a7d' 
  AND (
    token = '8CsG9h1i1mUOlOSpHGSL66QAD4wg8mL80Xg9Oo6Q8MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036