UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eP9XN7hBaS5qHOg1qQzfEH48y8ln3ufITh/CWTkRzuo=' 
WHERE 
  key_id = 'a5b03e58efcb97bb21b275bd5652ed8146ca69709bff6435748a087cf5d032b4' 
  AND (
    token = 'eP9XN7hBaS5qHOg1qQzfEH48y8ln3ufITh/CWTkRzuo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035