UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gBKxNExNNm5eWo+9MfgPeZY/TOOlykM3rrJdZ3QCrRY=' 
WHERE 
  key_id = '8084367e746f9ea87ed329bbfdb4a817d4221e69a1d18d1d7bf5bdb645a39432' 
  AND (
    token = 'gBKxNExNNm5eWo+9MfgPeZY/TOOlykM3rrJdZ3QCrRY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066